package com.datastructure.test.sumofsquare;

public class SumOfSquare {

    public static void main(String[] args) {

    }

    public boolean square (int c) {
        // write code here
        if(c==1){
            return false;
        }
        int mid = (int)Math.sqrt(c);
        for (int i = 1; i <= mid; i++) {
            for(int j = i;j<=mid;j++){
                if(i*i+j*j==c){
                    return true;
                }
            }
        }
        return false;
    }
}
